function constraints=generateConstraints(horizon, constraintsSeed)
constraints = [];

if (~isempty(constraintsSeed))
    bigTerm = constraintsSeed(1:end, 1:end-1);
    smallTerm = constraintsSeed(1:end, end:end);
    [rBigTerm cBigTerm] = size(bigTerm);
    [rSmallTerm cSmallTerm] = size(smallTerm);
    finalBigTerm = zeros(rBigTerm * horizon, cBigTerm * horizon);
    finalSmallTerm = zeros(rSmallTerm * horizon, 1);

    for i=1:horizon
        [rStartPointer rEndPointer] = getPointers(i, rBigTerm);
        [cStartPointer cEndPointer] = getPointers(i, cBigTerm);

        finalBigTerm(rStartPointer:rEndPointer, cStartPointer:cEndPointer) = bigTerm;
        finalSmallTerm(rStartPointer:rEndPointer, 1) = smallTerm;
    end

    constraints = [finalBigTerm finalSmallTerm];
end
end